<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	
	
<body>
	<h:form>
		<rich:panel style="width:50%">
			<f:facet name="header">
				Encabezado
			</f:facet>
			<h:panelGrid columns="2">
				<h:outputText value="Name:" />
				<h:inputText  value="#{demo.name}" />
				<h:outputText value="Echo:" />
				<h:outputText id="echo1" value="#{demo.name}" />
				<h:outputText value="Count:" />
				<h:outputText id="count1" value="#{demo.count}" />
			</h:panelGrid>
			<h:panelGroup id="greeting" >
		        <h:outputText value="Hola, " rendered="#{not empty demo.name}" />
	    		<h:outputText value="#{demo.name}" />
	            <h:outputText value="!" rendered="#{not empty demo.name}" />
	        </h:panelGroup>
			<a4j:commandButton value="Enviar"
				actionListener="#{demo.countListener}" reRender="echo1, count1, greeting" />		
        </rich:panel>
	</h:form>
</body>
</html>